package com.ruoyi.web.controller.common;

import com.ruoyi.framework.MqttPushClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @author: lxw
 * @Date: 2018/10/19 19:36
 * @email: 1229703575@qq.com
 * @Description: 测试文件
 */
@RestController
@Api("测试")
public class MqttTestController {

    @Autowired
    private MqttPushClient mqttPushClient;

    @ApiOperation(value = "发布主题", notes = "测试发布主题")
    @GetMapping(value = "/publishTopic")
    public void publishTopic(String content) {
        mqttPushClient.publish(0,false,"test/test",content);
    }
}
